#------------------------------------------------------------------------------
# Project:     Multi-Programmer Game Demo
# Name:        Ball.py
# Purpose:     Bouncing Ball Object
#
# Authors:     Sam Milender, Calvin Berger
# Main Author: Calvin Berger
#
# Created:     4/30/2013
# Copyright:   (c) Calvin Berger 2013
# Licence:     New BSD
#------------------------------------------------------------------------------
import pygame, math, sys, random

class Background(pygame.sprite.Sprite):
    def __init__(self, position, screenSize, image):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.images = []
        self.images = [pygame.image.load(image)]
        self.frame = 0
        self.maxFrame = len(self.images)-1
        self.image = self.images[self.frame]
        self.rect = self.image.get_rect()
        self.realx = position[0]
        self.realy = position[1]
        self.xOffset = 0
        self.yOffset = 0
        self.place(position)
        self.scrolling = False
     
    def place(self, position):
        self.rect.center = position
        #print "I've moved to", position
       
    def move(self):
        self.place([self.realx-self.xOffset, self.realy-self.yOffset])
   
    def update(*args):
        self = args[0]
        self.xOffset = args[1]
        self.yOffset = args[2]
        self.scrollingX = args[3]
        self.scrollingY = args[4]
        self.move()